package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.ArrayList;

public class BibliotecaApp {

    public static void main(String[] args) throws IOException {
        new BibliotecaApp().go();
    }

    public void go() throws IOException {
        Input input = new Input(new BufferedReader(new InputStreamReader(System.in)));
        Output output = new Output(new PrintStream(System.out));
        ArrayList<Book> books = new ArrayList<Book>();
        books.add(new Book("Head First Java"));
        books.add(new Book("Refactoring"));
        books.add(new Book("TDD By Example"));
        Library library = new Library(books, input, output);
        Menu menu = new Menu(input, output, library);
        menu.greet();
        library.printBooks();
        menu.display();
        menu.runMenuChoice();
    }

}
